<template>
  <van-tabbar v-model="active" active-color="	#FF6347" inactive-color="#000">
    <van-tabbar-item icon="wap-home-o" name="/home" to="/home">首页</van-tabbar-item>
    <van-tabbar-item icon="smile-comment-o" name="/dynamic" to="/dynamic">动态</van-tabbar-item>
    <!-- <van-tabbar-item icon="user-o" name="/shop" to="/shop">商城</van-tabbar-item> -->
    <van-tabbar-item icon="user-o" name="/mine" to="/mine">我的</van-tabbar-item>
  </van-tabbar>
</template>

<script setup>
import { onMounted, ref } from "vue";
import { useRouter } from 'vue-router'

const router = useRouter()
// const route = useRoute()
const active = ref('/home')

onMounted(() => {
  active.value = router.currentRoute.value.path
})

router.afterEach(() => {
  // console.log(route.path);
  active.value = router.currentRoute.value.path
})
</script>

<style>
</style>